<template>
	<view class="brand-list">
		<view class="brand-item" v-for="(data,index) in list" :key="index" @click="goBrandInfo(data.factory_id,data.style_id,data.style_name,data.factory_name)">
			<image :src="data.logo" mode="aspectFit"></image>
			<view class="brand-name">{{data.factory_name}}</view>
			<!-- <view class="brand-des">{{data.style?data.style:''}}</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			list: {
				type: Array,
				default () {
					return []
				}
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			goBrandInfo(factory_id,style_id,style_name,factory_name){
				if(style_id){
					uni.navigateTo({
						animationDuration: 500,
						url: '/brand-list/brand-info/brand-info?type=2&factory_id='+factory_id+'&style_id='+style_id + '&style_name='+style_name
					})
				}else{
					uni.navigateTo({
						animationDuration: 500,
						url: '/brand-list/brand-info/brand-info?type=1&factory_id='+factory_id
					})
				}
				this.$emit('brandAddFoot',factory_name)
			}
		}
	}
</script>

<style lang="scss">
	.brand-list{
		display: flex;
		flex-wrap: wrap;
		.brand-item{
			width: 33.3333%;
			text-align: center;
			border-bottom: solid 1px #faf7fa;
			border-right: solid 1px #faf7fa;
			padding: 50rpx 0;
			&:nth-child(3n){
				border-right: none;
			}
			image{
				width: 90rpx;
				height: 90rpx;
				vertical-align: top;
				border-radius: 8rpx;
			}
			.brand-name{
				margin: 20rpx 0;
				font-size: 28rpx;
			}
			.brand-des{
				padding: 0 20rpx;
				font-size: 22rpx;
				color: #141414;
				margin-top: 20rpx;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
			}
		}
	}
</style>